//
//  QTGCDTimer.h
//  Pods
//
//  Created by 张俊博 on 16/9/7.
//
//

#import <Foundation/Foundation.h>

@interface QTGCDTimer : NSObject


- (instancetype) initWithTimeInterval:(NSTimeInterval)seconds
                              repeats:(BOOL)repeats
                                queue:(dispatch_queue_t)queue
                                block:(dispatch_block_t)block;
+ (instancetype) scheduledTimerWithTimeInterval:(NSTimeInterval)seconds
                                        repeats:(BOOL)repeats
                                          queue:(dispatch_queue_t)queue
                                          block:(dispatch_block_t)block;

- (instancetype) initWithTimeInterval:(NSTimeInterval)seconds
                              repeats:(BOOL)repeats
                                queue:(dispatch_queue_t)queue
                               target:(id)target
                             selector:(SEL)selector;
+ (instancetype) scheduledTimerWithTimeInterval:(NSTimeInterval)seconds
                                        repeats:(BOOL)repeats
                                          queue:(dispatch_queue_t)queue
                                         target:(id)target
                                       selector:(SEL)selector;

/** 误差容忍程度 */
@property (atomic, assign) NSTimeInterval tolerance;

- (void) schedule;

- (void) fire;

- (void) invalidate;

@end
